package com.baidu.manager.modules.sys.controller;

import com.baidu.manager.modules.sys.entity.SysUser;
import org.apache.shiro.SecurityUtils;
import org.slf4j.LoggerFactory;

import org.slf4j.Logger;

/**
 * @Author: jql
 * @description: TODO(Controller公共组件)
 * @Date: Created by 14:59 2018/4/13
 */
public abstract class AbstractController {
    protected Logger logger = LoggerFactory.getLogger(getClass());

    protected SysUser getUser(){
        return (SysUser) SecurityUtils.getSubject().getPrincipal();
    }

    protected Long getUserId(){
        return getUser().getId();
    }

    protected Long getDeptId(){
        return getUser().getDeptId();
    }
}
